N=eval(input())
matrix=[]
i=0
while i<N:
    list1=[]
    list1=[0]*N
    matrix.append(list1)
    i+=1
i=1
x=1
y=(N//2)+1
matrix[x-1][y-1]=1
while i<N*N:
    if x<N+1 and y<N+1:
         if x==1 and y!=N:
              x=N
              y=y+1
         elif x!=1 and y==N:
             x=x-1
             y=1
         elif x==1 and y==N:
              x=x+1
              y=y
         else:
             if matrix[x-2][y]==0:
                  x=x-1
                  y=y+1
             else:
                  x=x+1
                  y=y
         matrix[x-1][y-1]=i+1
    i+=1
i=0
j=0
while i<N:
    print(' '.join(map(str,matrix[i])))
    i+=1